package com.itheima.heimatoutiaonews.controller;

import com.itheima.heimatoutiao.common.Result;
import com.itheima.heimatoutiaonews.domain.WmChannel;
import com.itheima.heimatoutiaonews.service.WmChannelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
@RequestMapping("v1/channel")
public class WmChannelController {
    @Autowired
    private WmChannelService wmChannelService;
    @GetMapping("/channels")
    public Result getchannels(){
        List<WmChannel> channels = wmChannelService.getChannels();
        return new Result(true,200,"成功",channels);
    }
}
